import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import BaseScrollList from "./BaseScrollList";

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
  title: "components/BaseScrollList",
  component: BaseScrollList,
  parameters: {
    // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
    layout: "centered",
  },
  // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
  tags: ["autodocs"],
  // More on argTypes: https://storybook.js.org/docs/api/argtypes
  argTypes: {},
  // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
  args: {},
} satisfies Meta<typeof BaseScrollList>;

export default meta;
type Story = StoryObj<typeof meta>;

export const BaseScrollListExample = {
  render: () => {
    const headerData = [
      "城市订单量",
      "店铺数",
      "人数",
      "新店铺数量",
      "人均订单量",
    ];
    const rowsData = [
      {
        cityOrder: "上海+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "北京+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "广州+15%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "深圳+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "武汉+21%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "成都+1%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "南京+18%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "杭州+13%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "重庆+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "安徽+10%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "上海+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "北京+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "广州+15%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "深圳+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "武汉+21%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "深圳+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "武汉+21%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "成都+1%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "南京+18%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "杭州+13%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
      {
        cityOrder: "重庆+12%",
        storyCount: 141,
        userCount: 174,
        newStoryC0unt: 152,
        avenger: 376,
      },
    ];

    return (
      <div style={{ minWidth: "500px" }}>
        <BaseScrollList
          headerData={headerData}
          rowsData={rowsData}
          rowNum={5}
          baseBg="pink"
          headerBg="gray"
          time={2000}
        ></BaseScrollList>
      </div>
    );
  },
};
